<template>
	<view>
		<scroll-view scroll-x="true" style="height: 100rpx; white-space: nowrap;">
			<view class="tab_item" :class="{'active':activeIn==index}" v-for="(item,index) in tabs" :key="index" @click="onChange(index)">
				{{item.value}}
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: 'lr-tabs',
		data() {
			return {
				activeIn: 0,
			}
		},
		props: {
			tabs: {
				type: Array,
				default () {
					return []
				}
			}
		},
		methods: {
			onChange(index) {
				this.activeIn = index;
				this.$emit('change', this.activeIn)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.tab_item {
		display: inline-block;
		padding:5rpx 20rpx;
		height: 58rpx;
		line-height: 58rpx;
		text-align: center;
		color: #333333;
		font-size: 26rpx;
		&.active {
			color: $main-color;
			font-size: 30rpx;
			font-weight: bold;
			border: 3rpx solid $main-color;
			border-radius: 90upx;
		}
	}


	
</style>
